Makes m case sensitive in TimeValue#19649
Merged
colings86 merged 1 commit intoelastic:masterfrom Jul 28, 2016
colings86:fix/timeValueWithMonths
Merged
Makes m case sensitive in TimeValue#19649colings86 merged 1 commit intoelastic:masterfrom colings86:fix/timeValueWithMonths
m case sensitive in TimeValue#19649colings86 merged 1 commit intoelastic:masterfrom
colings86:fix/timeValueWithMonths
Conversation
The reason for this change is that currently if a user specifies e.g.`2M` meaning 2 months as a time value instead of throwing an exception explaining that time units in months are not supported (due to months having variable time spans) we instead will parse this to 2 minutes. This could be surprising to a user and could mean put a lot of load on the cluster performing a task that was never intended and whose results will be useless anyway. It is generally accepted that `m` indicates minutes and `M` indicates months with time values so this is consistent with the expectations a user might have around specifying time units. A concrete example of where this causes issues is in the decay score function which uses TimeValue to parse the scale and offset parameters of the decay into millisecond values to use in the calculation. Relates to #19619
Contributor
|
LGTM. Thanks a lot. Will help! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The reason for this change is that currently if a user specifies e.g.
2Mmeaning 2 months as a time value instead of throwing an exception
explaining that time units in months are not supported (due to months
having variable time spans) we instead will parse this to 2 minutes.
This could be surprising to a user and could mean put a lot of load on
the cluster performing a task that was never intended and whose results
will be useless anyway.
It is generally accepted that
mindicates minutes andMindicatesmonths with time values so this is consistent with the expectations a
user might have around specifying time units.
A concrete example of where this causes issues is in the decay score
function which uses TimeValue to parse the scale and offset parameters
of the decay into millisecond values to use in the calculation.
Relates to #19619